Optimal. Leaf size=56 \[ \frac{a (B+C) \tan (c+d x)}{d}+\frac{a (B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a B \tan (c+d x) \sec (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.186527, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.184, Rules used = {3029, 2968, 3021, 2748, 3767, 8, 3770} \[ \frac{a (B+C) \tan (c+d x)}{d}+\frac{a (B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a B \tan (c+d x) \sec (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3029
Rule 2968
Rule 3021
Rule 2748
Rule 3767
Rule 8
Rule 3770
Rubi steps
\begin{align*} \int (a+a \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx &=\int (a+a \cos (c+d x)) (B+C \cos (c+d x)) \sec ^3(c+d x) \, dx\\ &=\int \left (a B+(a B+a C) \cos (c+d x)+a C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac{a B \sec (c+d x) \tan (c+d x)}{2 d}+\frac{1}{2} \int (2 a (B+C)+a (B+2 C) \cos (c+d x)) \sec ^2(c+d x) \, dx\\ &=\frac{a B \sec (c+d x) \tan (c+d x)}{2 d}+(a (B+C)) \int \sec ^2(c+d x) \, dx+\frac{1}{2} (a (B+2 C)) \int \sec (c+d x) \, dx\\ &=\frac{a (B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a B \sec (c+d x) \tan (c+d x)}{2 d}-\frac{(a (B+C)) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=\frac{a (B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a (B+C) \tan (c+d x)}{d}+\frac{a B \sec (c+d x) \tan (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0246544, size = 75, normalized size = 1.34 \[ \frac{a B \tan (c+d x)}{d}+\frac{a B \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a B \tan (c+d x) \sec (c+d x)}{2 d}+\frac{a C \tan (c+d x)}{d}+\frac{a C \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.055, size = 86, normalized size = 1.5 \begin{align*}{\frac{aC\tan \left ( dx+c \right ) }{d}}+{\frac{Ba\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{2\,d}}+{\frac{Ba\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+{\frac{aC\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{Ba\tan \left ( dx+c \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.12839, size = 128, normalized size = 2.29 \begin{align*} -\frac{B a{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 2 \, C a{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 4 \, B a \tan \left (d x + c\right ) - 4 \, C a \tan \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.62916, size = 239, normalized size = 4.27 \begin{align*} \frac{{\left (B + 2 \, C\right )} a \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (B + 2 \, C\right )} a \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (2 \,{\left (B + C\right )} a \cos \left (d x + c\right ) + B a\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.29587, size = 167, normalized size = 2.98 \begin{align*} \frac{{\left (B a + 2 \, C a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) -{\left (B a + 2 \, C a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{2 \,{\left (B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 2 \, C a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 3 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, C a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]